/*
package com.qutan.app.api.controller;

*/
/**
 * Created by pwy on 5/24/16.
 *//*


import com.qutan.app.core.domain.Info;
import com.qutan.app.core.domain.Scene;
import com.qutan.app.core.domain.UserInfo;
import com.qutan.app.core.domain.enumclass.SexType;
import com.qutan.app.core.domain.enumclass.ThreeLogin;
import com.qutan.app.core.domain.enumclass.Whether;
import com.qutan.app.core.manager.UserManager;
import com.qutan.app.core.repository.InfoRepository;
import com.qutan.app.core.repository.SceneRepository;
import com.qutan.app.core.repository.UserInfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import redis.clients.jedis.JedisCluster;
import redis.clients.jedis.JedisPool;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api")
public class UserController {

    @Autowired
    private UserInfoRepository userInfoRepository;

//    @Autowired
//    private UserManager userManager;

    @Autowired
    private SceneRepository sceneRepository;

    @Autowired
    private JedisCluster jedisCluster;

   */
/* @Autowired
    private JedisPool jedisPool;*//*


    @Autowired
    private InfoRepository infoRepository;

    @RequestMapping(value = "/test")
    @ResponseBody
    public List<UserInfo> hello(@RequestBody Map name){
         Map<String,String>resultMap=new HashMap<>();
        //resultMap.put("dd","rrr");
        UserInfo userInfo=new UserInfo();
        userInfo.setAddress("dddeeeeeeeee");
        userInfo.setNick_name("dd");
        userInfo.setSex(SexType.FEMALE);
        userInfo.setIsThirdLogin(ThreeLogin.NORMAL);
        userInfo.setTel("123");
       // userInfoRepository.save(userInfo);
        List<UserInfo> infos = userInfoRepository.findByTel("123");

       // userManager.isExist("123");
       */
/* Gift gift=new Gift();
        gift.setAmount(3);
        gift.setGiftName("ddd");
        gift.setLiveId(3333);
        giftRepository.save(gift);*//*


      */
/*  Jedis jedis = jedisPool.getResource();
        jedis.set("hellow","fuckme");
        String est=  jedis.get("hellow");
        System.err.println("-------"+est);*//*

        //jedisPool.getResource().geoadd()
        return infos;
    }



    @RequestMapping(value = "/testScene")
    @ResponseBody
    public String helloStr(@RequestParam("name")String name,@RequestParam("la")String la,@RequestParam("lo")String lo){

        Scene scene=new Scene();
        scene.setName(name);
        scene.setCity("440100");
        scene.setLatitude(Double.parseDouble(la));
        scene.setLongtitude(Double.parseDouble(lo));
        scene.setIsOnline(Whether.YES);
        sceneRepository.save(scene);
       return "helloWorold";
    }


    @RequestMapping(value = "/test2")
    @ResponseBody
    public String helloScene(){
        String test= jedisCluster.get("hello");
        jedisCluster.set("ccc","aaaa");
        jedisCluster.hset("test","a","hello");
        String ccc=jedisCluster.hget("test","a");
        return "helloWorold";
    }


    @RequestMapping(value = "/addTestInfo")
    @ResponseBody
    public String helloScene(@RequestParam("sceneId")String sceneId,@RequestParam("sceneName")String sceneName,@RequestParam("title")String title,@RequestParam("content")String content,@RequestParam("avatar")String avatar){

        long sid=Long.parseLong(sceneId);
        Info info=new Info();
        info.setAvatar(avatar);
        info.setContent(content);
        info.setTitle(title);
        info.setSceneName(sceneName);
        info.setSceneId(sid);

        infoRepository.save(info);
        return "helloScene";
    }

}
*/
